﻿Imports System.Collections.Generic
Imports System.Linq
Imports System.Data
Imports System.Text
Imports System.Windows.Forms
Imports DevComponents.DotNetBar.Controls
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.DTO
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.BUSS

Namespace DoAnQuanLyBanHang.DAO
    Public Class PhanNhomNguoiDungCtrl
        Private m_PhanNhomNguoiDungData As New PhanNhomNguoiDungData()
        Private m_PhanNhomNguoiDungInfo As New PhanNhomNguoiDungInfo()

        Public Sub HienThiComboBox(cbx As ComboBox)
            Dim m_DT As New DataTable()
            cbx.DataSource = m_DT
            cbx.DisplayMember = "MaNhomNguoiDung"
            cbx.ValueMember = "MaNV"
        End Sub

#Region "Hien thi ComboBox trong DataGridView"
        Public Sub HienThiDataGridViewComboBoxColumn(cmbColumn As DataGridViewComboBoxColumn)
            cmbColumn.DataSource = m_PhanNhomNguoiDungData.LayPhanNhomNguoiDung()
            cmbColumn.DisplayMember = "MaNhomNguoiDung"
            cmbColumn.ValueMember = "MaNV"
            cmbColumn.DataPropertyName = "MaNV"
            cmbColumn.HeaderText = "Ten dang nhap"
        End Sub
#End Region

        Public Sub HienThi(Dgv As DataGridView, bvn As BindingNavigator)
            Dim bs As New BindingSource()

            bs.DataSource = m_PhanNhomNguoiDungData.LayPhanNhomNguoiDung()
            bvn.BindingSource = bs
            Dgv.DataSource = bs
        End Sub

#Region "Them moi"
        Public Function ThemDongMoi() As DataRow
            Return m_PhanNhomNguoiDungData.ThemDongMoi()
        End Function
        Public Sub ThemPhanNhomNguoiDung(m_Row As DataRow)
            m_PhanNhomNguoiDungData.ThemPhanNhomNguoiDung(m_Row)
        End Sub
#End Region

#Region "Luu"
        Public Function LuuPhanNhomNguoiDung() As Boolean
            Return m_PhanNhomNguoiDungData.LuuPhanNhomNguoiDung()
        End Function
#End Region
    End Class
End Namespace